<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <th:block th:replace="~{/_include/header}" />
    <title>[[${title ?:'REBUILD'}]]</title>
    <style>
      html,
      body {
        height: 100%;
        padding: 0;
        margin: 0;
        background-color: #fff;
      }
    </style>
  </head>
  <body>
    <div id="viewer" style="width: 100%; height: 100%"></div>
    <script th:src="${OnlyofficeServer + '/web-apps/apps/api/documents/api.js'}"></script>
    <script>
      // https://api.onlyoffice.com/docs/docs-api/usage-api/config/
      new DocsAPI.DocEditor('viewer', {
        editorConfig: {
          mode: 'view',
          lang: 'zh',
          toolbar: false,
          menu: false,
          user: [(${_User})],
        },
        document: [(${_DocumentConfig})],
        token: '[[${_Token ?:""}]]',
        type: 'embedded',
      })
    </script>
  </body>
</html>
